/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bancoDeDados;

import java.sql.SQLException;
import regraDeNegocio.RNMovimentacao;

/**
 *
 * @author Gean
 */
public class BDMovimentacao {
    
    public void insertBD(RNMovimentacao mov) throws SQLException{
        Conexao c = new Conexao(); 
        c.insert("INSERT INTO movimentacao (`DtInicio`, `DtTermino`, `Termo`, `SituacaoMov`, `idBemPatrimonial`, `ResponsavelOrigem`, `ResponsavelDestino`, "
                + "`PredioOrigem`, `SalaOrigem`, `PredioDestino`, `SalaDestino`)VALUES('"+mov.getDt_hr_Inicio()+"','"+mov.getDt_hr_Termino()+"','"+
                mov.getTermo()+"','"+mov.getSituacaoMov()+"','"+mov.getBem()+"','"+mov.getResponsavelOrigem()+"','"+mov.getResponsavelDest()+
                "','"+mov.getPredioOrigem()+"','"+mov.getSalaOrigem()+"','"+mov.getPredioDest()+"','"+mov.getSalaDest()+"')");
   }
    
    public void updateBemBD(RNMovimentacao mov) throws SQLException{
        Conexao c = new Conexao(); 
        c.insert("UPDATE bempatrimonial SET Responsavel_SIAPE = "+mov.getResponsavelDest()+", idPredio = "+mov.getPredioDest()+
                ", idSala = "+mov.getSalaDest()+" Where idBemPatrimonial = "+mov.getBem());
   
    }
    
}
